package com.moss.cloud.base.biz.message;


import com.moss.cloud.common.core.constant.MsgGroup;
import com.moss.cloud.common.core.constant.MsgTopic;
import com.moss.cloud.common.core.model.dto.MessageDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 消息管理-监听 广播模式 MessageModel.BROADCASTING
 *
 * @author 瑾年
 * @date 2020/05/15
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = MsgGroup.MOSS_CLOUD_BASE, topic = MsgTopic.USER_LOGIN_MESSAGE, messageModel = MessageModel.BROADCASTING)
public class LoginMessageListener implements RocketMQListener<MessageDTO> {

    /**
     * 监听用户登录MQ消息
     *
     * @param messageDTO
     * @return void
     * @author 瑾年
     * @date 2020/05/15
     */
    @Override
    public void onMessage(MessageDTO messageDTO) {
        log.info("登录用户消费者获取消息:{}", messageDTO.toString());
    }
}
